package xuegao.study.mall.admin.feign;

import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.common.model.ums.UmsDepartment;
import xuegao.study.mall.common.vo.ums.UmsDepartmentVo;

import java.util.List;

@FeignClient(contextId = "department", name = "study-rbac-service", path = "/rbac/department")
public interface UmsDepartmentClient {

    @ApiOperation("部门保存")
    @PostMapping(value = "/save")
    CommonResult<String> save(@RequestBody UmsDepartment department);

    @ApiOperation("部门查询")
    @GetMapping(value = "/list")
    CommonResult<List<UmsDepartmentVo>> list();

    @ApiOperation("部门删除")
    @DeleteMapping(value = "/delete/{id}")
    CommonResult<Boolean> delete(@PathVariable Long id);

    @ApiOperation("部门修改")
    @PostMapping(value = "/update")
    CommonResult<Boolean> update(@RequestBody UmsDepartment department);
}
